<?php

namespace App\Http\Resources\exam;


use App\Models\exams\ExamQuestion;
use Illuminate\Http\Resources\Json\Resource;


class ExamQuestionDetailResource extends Resource
{

    public function __construct(ExamQuestion $resource)
    {
        $this->resource = $resource;
    }

    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'user_exam_id' => $this->resource->user_exam_id,
            'exam_question_id' => $this->resource->id,
            'exam_id' => $this->resource->exam_id,
            'question_id' => $this->resource->question_id,
            'question_cate' => $this->resource->question->type,
            'type' => $this->resource->question->type,
            'title' => $this->resource->question->title,
            'A' => $this->resource->question->A,
            'B' => $this->resource->question->B,
            'C' => $this->resource->question->C,
            'D' => $this->resource->question->D,
            'E' => $this->resource->question->E,
            'F' => $this->resource->question->F,
            'analysisi' => $this->resource->question->analysisi,
            'total' => $this->resource->total,
            'minute' => $this->resource->minute

        ];
    }
}
